<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Central de Estagio Aluno</title>
<link rel="StyleSheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/css/estilo.css" media="screen" />
    <link type="text/css" rel="stylesheet" href="#{facesContext.externalContext.requestContextPath}/css/tema/theme.css"/>
</h:head>
<h:body>
	<div align="center">

		<h:form>

			<h:panelGrid id="gridSelect">
				<p:selectOneMenu id="selectMat"
					value="#{MBMatricula.beanAluno.codAluno}" effect="drop"
					filter="true" required="true" requiredMessage="Selecione um curso!">
					<f:selectItem itemLabel="-Selecione um aluno" itemValue="" />
					<f:selectItems value="#{MBMatricula.listaMenuAluno}" var="mat"
						itemLabel="#{mat.nomeAluno}" itemValue="#{mat.codAluno}" />
					<p:ajax update="gridMat,listaCurso"
						listener="#{MBMatricula.auto(MBMatricula.beanAluno.codAluno)}" />
				</p:selectOneMenu>
			</h:panelGrid>

			<p:panelGrid id="gridMat" styleClass="semBorda">

				<p:row>
					<p:column colspan="3" style="width:100% font-size:10px">
						<div align="right">
							STATUS:
							<p:selectOneRadio value="#{MBMatricula.beanAluno.situacaoAluno}">
								<f:selectItem itemLabel="Ativo" itemValue="1" />
								<f:selectItem itemLabel="Inativo" itemValue="0" />
							</p:selectOneRadio>
						</div>
					</p:column>
				</p:row>
				<p:row>
					<p:column style="width:50% font-size:8px">Matrícula</p:column>
					<p:column style="width:50% font-size:8px" colspan="2">Nome</p:column>
				</p:row>
				<p:row>
					<p:column>
						<p:inputText value="#{MBMatricula.beanAluno.matriculaAluno}" />
					</p:column>
					<p:column colspan="2">
						<p:inputText value="#{MBMatricula.beanAluno.nomeAluno}" size="60" />
					</p:column>

				</p:row>
				<p:row>
					<p:column style="width:50% font-size:8px">Curso</p:column>
					<p:column style="width:50% font-size:8px">Periodo</p:column>
					<p:column style="width:50% font-size:8px">Data Nascimento</p:column>
				</p:row>
				<p:row>
					<p:column>
						<p:selectOneMenu value="#{MBMatricula.idcurso}" id="listaCurso">
							<f:selectItem itemValue="#{MBMatricula.beanAluno.curso.codCurso}"
								itemLabel="#{MBMatricula.beanAluno.curso.nomeCurso}" />
							<f:selectItems value="#{MBMatricula.listaMenu}" var="mat"
								itemLabel="#{mat.nomeCurso}" itemValue="#{mat.codCurso}" />
						</p:selectOneMenu>
					</p:column>
					<p:column>
						<p:selectOneMenu
							value="#{MBMatricula.beanAluno.periodoCursoAluno}">
							<f:selectItem itemLabel="Selecione..." itemValue="" />
							<f:selectItem itemLabel="Matutino" itemValue="Matutino" />
							<f:selectItem itemLabel="Vespertino" itemValue="Vespertino" />
							<f:selectItem itemLabel="Noturno" itemValue="Noturno" />
						</p:selectOneMenu>
					</p:column>
					<p:column>
						<p:inputMask mask="99/99/9999" value="#{MBMatricula.dtNasc}"
							required="true">

						</p:inputMask>
					</p:column>
				</p:row>

			</p:panelGrid>

			<p:commandButton id="cbtAlterar" value="Alterar"
				action="#{MBMatricula.update}" icon="ui-icon-pencil" />

		</h:form>
	</div>
</h:body>
</html>